/* -*- C++ -*- */

//=============================================================================
/*
* @author Feloweria <380374483@qq.com>
* Copyright (C) Feloweria
*
* $ID 2014-06-14 06:58:06 PM
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
* @version 1.0
*/
//=============================================================================
#ifndef FLOWRIA_USER_SOCKET_INCLUDE
#define FLOWRIA_USER_SOCKET_INCLUDE

#include "Base/TimeValue.h"
#include "Network/Acceptor.h"
#include "Game/WorkThread.h"
#include "Base/StringConvertor.h"
using namespace Felowria;

class UserSocket :public Socket
{
public:
    UserSocket() {}
    ~UserSocket() {}
    
public:
    virtual void OnConnect() {last_ping_time = cur_time;}
    virtual void OnDisconnect() {
	static int i = 0;
	++i;
	LOG_TRACE(String("Disconnect Count:") + StringConvertor<UTF8>::ToString(i));
	}

public:
	TimeValue last_ping_time;    
};

#endif //FLOWRIA_USER_SOCKET_INCLUDE
